package com.oocl.servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.oocl.factory.ServiceFactory;
import com.oocl.pojo.Food;
import com.oocl.service.FoodService;
/**
 * 模糊搜索
 * @author XIEMI2
 *
 */
public class FuzzySearchServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
	private FoodService foodService; 
    /**
     * @see HttpServlet#HttpServlet()
     */
    public FuzzySearchServlet() {
        super();
        foodService = ServiceFactory.getFoodService();
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doPost(request, response);
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		String keyWord = request.getParameter("keyWord");
		List<Food> foods = foodService.findByFuzzy(keyWord);
		//测试通过，可以拿到数据的
	}

}
